package test;

import java.util.Scanner;

public class Homework2 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        char[] arr = str.toCharArray();
        System.out.println(arr.length);
        StringBuffer buffer = new StringBuffer(str);
        System.out.println(buffer.reverse());
    }
}
